package com.neusoft.yuejian_6.activity;

import android.app.Activity;
import android.content.Intent;
import android.support.v7.app.AppCompatActivity;
import android.os.Bundle;
import android.view.View;
import android.view.Window;
import android.widget.Button;

import com.neusoft.yuejian_6.R;

public class GoActivity extends Activity {


    private Button gobutton, logbutton;

    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        requestWindowFeature(Window.FEATURE_NO_TITLE);//去掉标题栏

        setContentView(R.layout.activity_go);
        initViews();
        initEvents();
        initData();


    }

    //初始化
    public void initViews() {

        logbutton = (Button) findViewById(R.id.logbutton);
        gobutton = (Button) findViewById(R.id.gobutton);


    }

    public void initEvents() {

        // Button registerbutton= (Button)findViewById(R.id.regbutton);
        gobutton.setOnClickListener(
                new View.OnClickListener() {

                    @Override
                    public void onClick(View view) {
                        Intent intent = new Intent();
                        intent.setClass(GoActivity.this, RegActivity.class);
                        startActivityForResult(intent, 1);

                    }
                });

        logbutton.setOnClickListener(
                new View.OnClickListener() {

                    @Override
                    public void onClick(View view) {
                        Intent intent = new Intent();
                        intent.setClass(GoActivity.this, LoginActivity.class);
                        startActivityForResult(intent, 2);

                    }
                });
    }

    public void initData() {

    }
}
//  @Override
//    public void onActivityResult(int requestCode, int resultCode, Intent data) {
//        super.onActivityResult(requestCode, resultCode, data);
//        if(requestCode==1&&resultCode==RESULT_OK) {
//            String usrname = data.getStringExtra("username");
//            username.setText(usrname);
//        }
//    }

